var app = getApp(),
  $ = require("../../utils/httpHelper.js")
Page({
  data: {
    indexArray: [],
    userInfo: {},
    fans_num:'',
    fav_num:'',
    cart_num:''
  },
  onShareAppMessage: function (res) {
    app.shareApp(res)
  },
  onLoad: function (e) {
    var that = this;
    this.setData({ userInfo: app.globalData.userInfo })
   
    
  },
  onShow:function(e){
    $.httpPost("member_index", { rd_session: app.globalData.userInfo.rd_session }, (data, err) => {
      this.setData({
        fans_num: data.data.fans,
        fav_num: data.data.favorite,
        cart_num: data.data.cart
      })
    })
  },
  toorder:function(e){
    let id = e.currentTarget.dataset.id
    console.log(e)
    wx.navigateTo({
      url: '/pages/order/order?id='+id,
    })
  },
  toyhq(){
    wx.navigateTo({
      url: '/pages/yhq/mineyhq',
    })
  },
  tofans(){
    wx.navigateTo({
      url: '/pages/mine/myfans',
    })
  },
  tomoney(){
    wx.navigateTo({
      url: '/pages/mine/money',
    })
  },
  tofenxiao(){
    wx.navigateTo({
      url: '/pages/myvault/unfenx',
    })
    // let memberType = app.globalData.userInfo.member_type
    // console.log(memberType)
    // if (memberType == 0 || memberType == 4 || memberType == 6
    //   || memberType == 8 || memberType == 10 || memberType == 12 || memberType == 14
    //   || memberType == 16 || memberType == 18 || memberType == 20 || memberType == 24 
    //   || memberType == 26 || memberType == 28 || memberType == 30 || memberType == 34 
    //   || memberType == 36 ){
    //   wx.navigateTo({
    //     url: '/pages/myvault/unfenx',
    //   })
    // }else{
    //   wx.showToast({
    //     title: '没有权限',
    //   })
    // }
    
  },
  tomineclass(e) {
    let status = e.target.dataset.status
    wx.navigateTo({
      url: '/pages/kecheng/myclass?status=' + status,
    })
  },
  tojifen(){
    wx.navigateTo({
      url: '/pages/jifen/jifen',
    })
  },
  toyuangong(){
    wx.navigateTo({
      url: '/pages/mine/yuangong',
    })
  },
  tocar() {
    wx.navigateTo({
      url: '/pages/car/shop-cart',
    })
  },
  toinfo(){
    wx.navigateTo({
      url: '/pages/mine/info',
    })
  },
  tocolle(){
    wx.navigateTo({
      url: '/pages/mine/colle',
    })
  },
  toadr() {
    wx.navigateTo({
      url: '/pages/address/addressli?adr_num=' + this.data.adr_num,
    })
  },
  tocolle(){
    wx.navigateTo({
      url: '/pages/mine/colle',
    })
  },
  tovip(){
    wx.navigateTo({
      url: '/pages/mine/member',
    })
  },
  
  toabout(){
    wx.navigateTo({
      url: '/pages/yeni/about',
    })
  }
  
});